package cn.liontalk.IteratorPattern.noIterator;

public class NetEaseMusic1 {

    private IList1 songList;
    public NetEaseMusic1() {
        songList = new SongList1(3);
        songList.add(new Song("让我留在你身边", "陈奕迅"));
        songList.add(new Song("你曾是少年", "SHE"));
        songList.add(new Song("Perfect", "Ed Sheeran"));
    }

    /**
     * 列表循环
     */
    public void listenToMusicByLoop() {
        for (int i = 0; i < songList.size(); i++) {
            System.out.println("听歌：" + ((ISong)songList.get(i)).getSongInfo());
        }
    }

}
